﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleArraynForeach
{
    class Program
    {
        static void Main(string[] args)
        {
            int [] numbers = {12,18,17,86,60,40,51,27,10,71};
            string div2 = "";
            string div3 = "";
            string div2n3 = "";

            foreach (int x in numbers)
            {
                if (x % 2 == 0)
                {
                 div2 += x + " ";
                }               
                if (x % 3 == 0)
                {
                 div3 += x + " ";
                }
                if (x % 2 == 0 && x % 3 == 0)
                {
                 div2n3 += x + " ";
                }
            }
            Console.WriteLine("Divided by 2 w/o fraction: " + div2);
            Console.WriteLine("Divided by 3 w/o fraction: " + div3);
            Console.WriteLine("Divided by 2 and by 3 w/o fraction: " + div2n3);
        }
       
    } 
}
